package com.lzwork.gpt.db.entity;

import java.util.Map;

import com.lzwork.gpt.utility.caller.OpenApiCaller;
import com.lzwork.utility.collection.MapReader;
import com.lzwork.web.db.SqlEntity;

import lombok.Getter;
import lombok.Setter;

/**
 * @author LiZheng
 * @date 2023年11月21日 下午5:00:59
 */

@Getter
@Setter
public class ModelEntity extends SqlEntity
{
	private static final long serialVersionUID = 1L;

	String url = "";
	String model = "";
	String info = "";
	String token = "";
	int type = 0;

	public static ModelEntity loadFromMap(Map<?, ?> map)
	{
		ModelEntity result = MapReader.deserialize(map, ModelEntity.class, true, EntityParse.parseSetting());

		return result;
	}

	public OpenApiCaller makeOpenApiCaller()
	{
		return new OpenApiCaller(url, token, model);
	}
}
